home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 21
/
Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso
/
Aminet
/
dev
/
e
/
dclistview.lha
/
dclistview.doc
< prev
next >
Wrap
Text File
|
1997-08-19
|
4KB
|
85 lines
DCListview PLUGIN
-----------------
This plugin creates a GadTools Listview gadget, almost identical to the
standard EasyGUI one, except that it will also report double-clicks on list
items. (Be sure to set the 'isgt' field of the PLUGIN gadget to 'TRUE', since
this uses a GadTools gadget)
Constructors:
dclistview(label=NIL,relx=0,rely=0,execlist=NIL,
current=0,key=NIL,disabled=FALSE)
where:
label -> the label for the gadget
relx,rely -> the usual relative gadget width/height (both default to 5)
execlist -> the list to be displayed in the gadget
current -> the list item to be placed at the top of the listview.
This item will also be displayed beneath the listview
under v37 or with a highlight bar under v39. This value
will always be updated when the user selects a list item.
** NOTE: If you don't want ANY list item highlighted
initally, set current=-1.
** ALSO NOTE: Item highlighting is always set for this plugin
gadget. This makes the most sense when using double-click
sensing. Of course, this can always be changed... :)
key -> keyboard shortcut ("a".."z","A".."Z"). Include a "_" in
the label string to indicate this visually.
disabled -> whether this gadget is disabled (v39+)
Destructor:
END *must* be called for each NEWed object.
Data (should be considered read-only):
OBJECT dclistview OF plugin
disabled -> disabled or enabled
current -> the currently selected item
clicked -> TRUE if an item has just been double-clicked
PRIVATE ...
ENDOBJECT
New methods:
setdclist(list) -> change the list attached to the gadget;
getdclist() -> returns the list attached to the gadget;
setdctop(top) -> change which item is at the top;
setdccurrent(current) -> change which item is selected. Can also be
set to -1 to have no item selected. This
function returns the actual 'current' value,
useful if you specify a 'current' that's out
range.
setdisabled(disabled=TRUE) -> disable/enable the gadget.
Action functions:
Your action function will be called (or your action value returned by
easyguiA()) in the following circumstances:
- when an item is selected with the mouse, and again on a double click
NOTE: if you use an action value instead of an action function, you
obviously won't hear about double clicks since your GUI will
have closed :) ;
- when the assigned key is pressed, alone or shifted.
Exceptions:
"dclv" will be raised by gtrender() if the gadget can't be created.
Other notes:
1) The CONST DCLIST (which =PLUGIN) is available to be used in your EasyGUI
gadget list, e.g., [DCLIST, {listaction}, dclist, TRUE]. This can make plugins
in gadget lists easier to identify, especially if you use a lot of different
Plugins.
2) The value of the 'current' field will NOT change if the user does not
manipulate the listview in any way. If you set 'current' to -1 at any point,
be prepared to properly handle -1 as a returned value when you read the
'current' field.
3) Disabling of listviews under v39+ is minimal at best. While the main
list gadget is disabled, the prop gadget will still scroll the list.
4) I replaced a v39+ function that inadvertently crept into the code
(twice!). I should read the autodocs more closely. :)